import React, { PureComponent } from 'react';

export default class CategoryIcons extends PureComponent {
    static iconSrcMap = {
        gray: {
            cateId0: 'https://cdn.weipaitang.com/static/20190711a3a810e4-8af7-4f58-bd4a-7fe49224c103-W72H72',
            cateId1: 'https://cdn.weipaitang.com/static/20190711ba387e7d-6826-4e5e-a242-632db94b94b3-W72H72',
            cateId2: 'https://cdn.weipaitang.com/static/201907110da68c81-5a38-490e-90af-f40e65bdbf5b-W72H72',
            cateId3: 'https://cdn.weipaitang.com/static/20190711836b5d4f-71ea-4815-a6c1-8c4b9990eb98-W72H72',
            cateId4: 'https://cdn.weipaitang.com/static/20190711c112b450-159a-404e-8ff4-41337fa7bd8e-W72H72',
            cateId5: 'https://cdn.weipaitang.com/static/20190711fd873df5-b262-43ed-bf83-637795023396-W72H72',
            cateId7: 'https://cdn.weipaitang.com/static/20190711e9819073-69d5-46e5-83f6-2a23a2978d2a-W72H72',
        },
        orange: {
            cateId0: 'https://cdn.weipaitang.com/static/20190711a79b7b6d-b1d0-462c-a1c8-d8bf0f8d118f-W72H72',
            cateId1: 'https://cdn.weipaitang.com/static/20190711138e5f35-29e1-4df4-ab5b-7af3eeea48e6-W72H72',
            cateId2: 'https://cdn.weipaitang.com/static/201907110c774d88-8289-471e-b024-a3bf0293732f-W72H72',
            cateId3: 'https://cdn.weipaitang.com/static/20190711fc4d957c-0df8-47ea-b1e0-0e4acc1c4346-W72H72',
            cateId4: 'https://cdn.weipaitang.com/static/2019071116b35ea3-985f-4a97-8cbb-10c5a6906cc3-W72H72',
            cateId5: 'https://cdn.weipaitang.com/static/2019071141afefdd-c354-4b92-9b24-28bb5276e96a-W72H72',
            cateId7: 'https://cdn.weipaitang.com/static/201907111041a5a4-4a8c-4d0f-aae6-bbb34abfee1f-W72H72',
        },
    };

    // cateId 根据品类0-7返回对应icon
    // 0文玩杂项 1玉翠珠宝 2书画纂刻 3茶酒滋补 4紫砂陶瓷 5工艺作品 7花鸟文娱
    // color 颜色 gray、orange
    render() {
        const { cateId, color } = this.props;
        return <img src={CategoryIcons.iconSrcMap[color][`cateId${cateId}`]} {...this.props} />;
    }
}
